<template>
  <div>
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <el-menu-item index="1" @click="main()">首页</el-menu-item>
      <template>
        <el-menu-item index="2" @click="register()">注册</el-menu-item>
        <el-menu-item index="3" @click="login()">登录</el-menu-item>
      </template>
      <template>
        <el-menu-item index="4" @click="UserPage()">控制台</el-menu-item>
      </template>
      <el-menu-item index="5" @click="getCookieUserName()">q</el-menu-item>
    </el-menu>
  </div>
</template>


<script>
export default {
  name: "Header",
  data() {
    return {
      info: [],
      activeIndex: "1",
      getSessionUserName: "",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    main() {
      this.$router.push({ path: "/admin/index" });
    },
    register() {
      this.$router.push({ path: "/admin/updateAdminUser" });
    },
    login() {
      this.$router.push({ path: "/admin/login" });
    },
    UserPage() {
      this.$router.push({ path: "/admin/login" });
    },
  },
};
</script>


<style>
</style>
